package crack3d.lshape.mesh1;

import math2.MathUtilities;
import crack3d.AbstractLshape3dUsingSDAElement;
import fem2.AbstractStructuralCrackDemo;
import fem2.Element;
import fem2.MaterialModel;
import fem2.MeshPart;
import fem2.Model;
import fem2.element.crack_sda.SOSConstantJumpTetrahedraElement;
import fem2.material.cohesive_law.CohesiveLaw;
import fem2.material.cohesive_law.Mode1LinearCohesiveLaw;

public class Lshape3dMesh1_SOSConstantJumpTetrahedraElement_LinearCohesiveLaw extends
		AbstractLshape3dUsingSDAElement {

	public Lshape3dMesh1_SOSConstantJumpTetrahedraElement_LinearCohesiveLaw() {
		meshFileName = "mesh1-sos-linear.msh";
	}

	@Override
	public Element createElement(MeshPart mp, MaterialModel mm, CohesiveLaw cl) {
		SOSConstantJumpTetrahedraElement e = new SOSConstantJumpTetrahedraElement(mp, mm, cl);
		// e.setEchoLevel(EchoLevelType.AUX4);
		return e;
	}

	@Override
	public CohesiveLaw createCohesiveLaw(Model m) {
		double ft = 2.7;
		double Gf = 0.065;
		double km1 = 1e10;
		double km2 = 1e10;
		return new Mode1LinearCohesiveLaw(Gf, ft, km1, km2);
	}

	public static void main(String[] args) {
		AbstractStructuralCrackDemo demo = new Lshape3dMesh1_SOSConstantJumpTetrahedraElement_LinearCohesiveLaw();

		// double[] lambda = LinAlgUtilities.createLambdaArray(17.1, 0.1, 17.2);
		// double[] lambda = LinAlgUtilities.createLambdaArray(17.1, 0.1, 20);
		// double[] lambda = LinAlgUtilities.createLambdaArray(17.1, 0.1, 25);
		double[] lambda = MathUtilities.createLambdaArray(17.1, 0.1, 30);
		// bad
		// result

		demo.run(lambda);
	}
}
